home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / CDTools / MUIRexx / demos / MUIRexxBuild / ask_comm.rexx < prev    next >
OS/2 REXX Batch file  |  1997-04-21  |  3KB  |  112 lines

  1. /* */
  2. options results
  3. parse arg comm' 'name
  4.  
  5. MUIA_AppMessage =                 0x80421955 /* V5  ..g struct AppMessage * */
  6. MUIA_Frame =                           0x8042ac64 /* V4  i.. LONG              */
  7. Disabled =                        0x80423661 /* V4  isg BOOL              */
  8. Image_FontMatch =                 0x8042815d /* V4  i.. BOOL              */
  9.  
  10. MUIV_EveryTime = 0x49893131
  11. TRUE = 1
  12. FALSE = 0
  13.  
  14. address BUILD
  15.  
  16. cycle ID L2
  17. type = result
  18.  
  19. select
  20.     when comm = 'SET' then do
  21.         if name = '' then do
  22.             popasl ID S7
  23.             name = result
  24.         end
  25.         if index(name,'.info') > 0 then do
  26.             name = substr(name,1,index(name,'.info')-1)
  27.             type = 'Icon'
  28.             switch ID C1 ATTRS Disabled TRUE
  29.             cycle ID L2 LABEL 'Icon'
  30.         end
  31.         switch ID C1
  32.         if result ~= 'Transparent' then TRANS = ''
  33.         group ID GIMG
  34.             select
  35.                 when type = 'Icon' then switch ID AIMG ICON name
  36.                 when type = 'Picture' then switch ID AIMG PICT name TRANS
  37.                 when type = 'None' then switch ID AIMG ATTRS MUIA_Frame 0
  38.                 otherwise nop
  39.             end
  40.         endgroup
  41.         callhook ID AIMG APP COMMAND '"build:ask_comm SET %s"'
  42.         popasl ID S7 CONTENT name
  43.     end
  44.     when comm = 'IMAGE' then do
  45.         select
  46.             when type = 'Icon' then do
  47.                 switch ID C1 ATTRS Disabled TRUE
  48.                 popasl ID S7 ATTRS Disabled FALSE
  49.                 poplist ID S8 ATTRS Disabled TRUE
  50.             end
  51.             when type = 'Image' then do
  52.                 switch ID C1 ATTRS Disabled TRUE
  53.                 popasl ID S7 ATTRS Disabled TRUE
  54.                 poplist ID S8 ATTRS Disabled FALSE
  55.             end
  56.             when type = 'Picture' then do
  57.                 switch ID C1 ATTRS Disabled FALSE
  58.                 popasl ID S7 ATTRS Disabled FALSE
  59.                 poplist ID S8 ATTRS Disabled TRUE
  60.             end
  61.             when type = 'None' then do
  62.                 switch ID C1 ATTRS Disabled TRUE
  63.                 popasl ID S7 ATTRS Disabled TRUE
  64.                 poplist ID S8 ATTRS Disabled TRUE
  65.             end
  66.             otherwise nop
  67.         end
  68.         popasl ID S7 CONTENT ''
  69.         poplist ID S8 CONTENT ''
  70.     end
  71.     when comm = 'ISET' then do
  72.         poplist ID S8
  73.         sname = result
  74.         sval = name
  75.         name = ''
  76.         call open('images','build:images.lst','R')
  77.         do while ~eof('images')
  78.             line = readln('images')
  79.             if line = '' then leave
  80.             parse var line vname '=' value .
  81.             if sname = '' then do
  82.                 if value = sval then do
  83.                     sname = vname
  84.                     poplist ID S8 CONTENT sname
  85.                     leave
  86.                 end
  87.             end
  88.             else do
  89.                 if index(vname,sname) > 0 then do
  90.                     sval = value
  91.                     leave
  92.                 end
  93.             end
  94.         end
  95.         call close('images')
  96.         group ID GIMG
  97.             switch ID AIMG SPEC '"6:'sval'"' ATTRS Image_FontMatch TRUE MUIA_Frame 0
  98.         endgroup
  99.     end
  100.     when comm = 'CLASS' then do
  101.         check ID C1
  102.         if result then dirlist ID D1 PATH '"SYS:Classes/Gadgets"'
  103.         else dirlist ID D1 PATH '"MUI:Libs/MUI"'
  104.         string ID S6 CONTENT ''
  105.     end
  106.     when comm = 'CSET' then do
  107.         string ID S6 CONTENT substr(name,lastpos('/',name)+1)
  108.     end
  109.     otherwise nop
  110. end
  111. exit
  112.